package com.guyaogg.common.constant;

/**
 * @author 顾遥
 */
public class ProductConstant {


    public enum AttrEnum{
        /**
         * Attr 的枚举类性
         */
        ATTR_TYPE_BASE(1,"基本属性","base"),
        ATTR_TYPE_SALE(0,"销售属性","sale");
        private final int code;
        private final String msg;
        private final String type;

        AttrEnum(int code,String msg,String type){
            this.code = code;
            this.msg = msg;
            this.type = type;
        }

        public int getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }

        public String getType() {
            return type;
        }
    }

    public enum ProductUpStatusEnum {
        /**
         * 商品上架 的枚举类性
         */
        NEW_SPU(0,"新建"),
        SPU_UP(1,"上架"),
        SPU_DOWN(2,"下架");
        private final int code;
        private final String msg;


        ProductUpStatusEnum(int code, String msg){
            this.code = code;
            this.msg = msg;

        }

        public int getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }

    }
    public static boolean isBaseType(int code){
        return code == AttrEnum.ATTR_TYPE_BASE.getCode();
    }
}
